package com.cu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
@RequestMapping("user")
public class SpringbootRunApp {
    @Autowired
    private RedisTemplate redisTemplate;
    public static void main(String[] args) {
        SpringApplication.run(SpringbootRunApp.class, args);
    }
    @GetMapping("list")
    public void lpush(){
        ListOperations ops = redisTemplate.opsForList();
        String[] str = new String[]{"yangyang","yangrong","yangshiwan"};
        ops.leftPushAll("name", str);


    }

}
